import '@tarojs/async-await'
import Taro, { Component } from '@tarojs/taro'
import Index from './pages/index'

import './app.scss'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {
  config = {
    pages: [
      'pages/index/index',
      'pages/login/index',
      'pages/chooseCity/index',
      'pages/bind/index',
      'pages/celebration/index',
      'pages/feast/index',
      'pages/shop/index',
      'pages/user/index'
    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: '闪个婚',
      navigationBarTextStyle: 'black'
    },
    permission: {
      'scope.userLocation': {
        desc: '根据您的地理位置自动选择店铺'
      }
    },
    tabBar: {
      color: '#68676c',
      selectedColor: '#ff1d41',
      list: [
        {
          pagePath: 'pages/celebration/index',
          iconPath: './images/tabbar/celebration.png',
          selectedIconPath: './images/tabbar/celebration_active.png',
          text: '婚庆'
        },
        {
          pagePath: 'pages/feast/index',
          iconPath: './images/tabbar/feast.png',
          selectedIconPath: './images/tabbar/feast_active.png',
          text: '婚宴'
        },
        {
          pagePath: 'pages/index/index',
          iconPath: './images/tabbar/home.png',
          selectedIconPath: './images/tabbar/home_active.png',
          text: '首页'
        },
        {
          pagePath: 'pages/shop/index',
          iconPath: './images/tabbar/shop.png',
          selectedIconPath: './images/tabbar/shop_active.png',
          text: '体验'
        },
        {
          pagePath: 'pages/user/index',
          iconPath: './images/tabbar/user.png',
          selectedIconPath: './images/tabbar/user_active.png',
          text: '我的'
        }
      ]
    }
  }

  componentDidMount() {}

  componentDidShow() {}

  componentDidHide() {}

  componentDidCatchError() {}

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return <Index />
  }
}

Taro.render(<App />, document.getElementById('app'))
